using System;
using UnityEngine;

namespace RGuang.PlathformCtrl
{
    public class GateTrigger : MonoBehaviour
    {

        [SerializeField] VoidEventChannel gateTriggerEventChannel;
        [SerializeField] AudioClip pickUpSound;
        [SerializeField] ParticleSystem pickUpVFX;
        private void OnTriggerEnter(Collider other)
        {
            gateTriggerEventChannel.Broadcast();
            SoundEffectPlayer.AudioSource.PlayOneShot(pickUpSound);
            Instantiate(pickUpVFX, transform.position, Quaternion.identity);
            Destroy(gameObject);
        }
    }
}

